/**
 * @Author: yy
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-08-13 15:07:10
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';
//  查询战败原因列表
export const searchDefeatReason = params => axios.get(`${SERVER.CYXDMS_CLUE}/basedata/defeats`, { params });
//  查询战败原因列表DLR专用
export const searchDefeatReasonDLR = params => axios.get(`${SERVER.CYXDMS_CLUE}/basedata/defeats/dlr`, { params });
//  战败信息单条查询
export const searchDefeatReasonOne = id => axios.get(`${SERVER.CYXDMS_CLUE}/basedata/defeats/${id}`, { id: Number(id) });
//  战败原因新增
export const addDefeatReason = params => axios.post(`${SERVER.CYXDMS_CLUE}/basedata/defeats`, params);
//  战败原因编辑保存
export const editDefeatReason = (params,id) => axios.put(`${SERVER.CYXDMS_CLUE}/basedata/defeats/${id}`, params);


